<script setup lang="ts">
import {reactive} from "vue";
import Vue005Son from "./Vue005Son.vue";

const data = reactive({
  money:100,
  books:["西游记","水浒传"]
})

function moneyMinis(arg) {
  // alert("感知到儿子买了棒棒糖" + arg);
  data.money += arg;
}
</script>

<template>

  <button @click="data.money+=10">充值</button>

<!-- @buy 感知buy事件，并通过函数结束事件的值 -->
  <Vue005Son v-bind="data" @buy="moneyMinis">
    <!-- 在组件标签内部写html，子组件就可以通过<slot/>来接收   -->
    <button>哈哈Son</button>
  </Vue005Son>


</template>

<style scoped>

</style>